package main

import "fmt"

func main() {
	var S, E int
	_, _ = fmt.Scan(&S, &E)

	if S == E {
		fmt.Println(0)
		fmt.Println(1)
		fmt.Println(S)
		return
	}

	if E%S == 0 {
		fmt.Println(0)
		fmt.Println(2)
		fmt.Printf("%d %d\n", S, E)
	}

	for i := 1; i < 10000; i++ {
		if S-i > 0 && E%(S-i) == 0 {
			fmt.Println(i)
			fmt.Println(3)
			fmt.Printf("%d %d %d\n", S, S-i, E)
			return
		}
		if E%(S+i) == 0 {
			fmt.Println(i)
			fmt.Println(3)
			fmt.Printf("%d %d %d\n", S, S+i, E)
			return
		}
	}
}
